<jsp:useBean id="sessiondata" class="bibbletex.models.SessionData"
	scope="session" />

<%@ page import="bibbletex.models.Collaboration, bibbletex.controllers.CollaborationController"%>

<%
	String page_title;
	String onloadjsfunction="";
	Collaboration c = null;
	String id_parameter = request.getParameter("cid");
	boolean show_title = true;
	String message = null;
	
	page_title = new String("Edit Collaboration");
	
	if (id_parameter == null)
	{
		if (sessiondata.collaboration == null)
			message = new String("No collaboration ID provided");
		else
			c = sessiondata.collaboration;
	}
	else
	{
		if (Collaboration.id_is_private(id_parameter))
		{
			c = CollaborationController.load(id_parameter);
			sessiondata.collaboration = c;
		}
		else
			message = new String("You do NOT have right to do that.");
	}
%>

<%@ include file="/header.jsp"%>

<% if (message != null) { %>
<h4><%=message %></h4>
<% 
	} 
	else if (c != null) { 
%>

<%@ include file="/collaboration/form.jsp" %>

<% } %>

<%@ include file="/footer.jsp"%>
